<?php
// to count entries

function getAllCountEntries() {
	$sql = "
		SELECT 
		e_to_cat.category_id, 
		COUNT(e_to_cat.entry_id) 
	FROM 
		s_kb_entry e,
		s_kb_category cat,
		s_kb_entry_to_category e_to_cat
	WHERE 1
		AND e_to_cat.entry_id = e.id
		AND e_to_cat.category_id = cat.id
		AND e.active = 1
		AND cat.active = 1
	GROUP BY e_to_cat.category_id";
}

?>